﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace lab03
{
    class Program
    {
        static int ReadStringFromConsole(string displayText) 
        {
            int sNumVal;
            bool result;
            do
            {
                Console.WriteLine(displayText);
                string s = Console.ReadLine();
                result = Int32.TryParse(s, out sNumVal);
                if (!result)
                {
                    Console.WriteLine("Error, enter number");
                }
            } while (!result);
            return sNumVal;
           
        }
        static void PrintStringToConsole(int str, string displayMsg)
        {
            Console.Write(displayMsg);
            Console.WriteLine(str);
        }


        static void Main(string[] args)
        {
            int num1 = Program.ReadStringFromConsole("Enter first number");
            int num2 = Program.ReadStringFromConsole("Enter second number");
            int num3 = Program.ReadStringFromConsole("Enter third number");

            Program.PrintStringToConsole(num3, "Third number:");
            Program.PrintStringToConsole(num2, "Second number:");
            Program.PrintStringToConsole(num1, "First number");

            Console.ReadKey();
        }
    }
}
